/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

//todo enum
export const enum YogaWrap {
  NO_WRAP = 0,
  WRAP = 1,
  WRAP_REVERSE = 2,
}

export function getYogaWrapFromNumber(value: number): YogaWrap | never {
  switch (value) {
    case 0: return YogaWrap.NO_WRAP;
    case 1: return YogaWrap.WRAP;
    case 2: return YogaWrap.WRAP_REVERSE;
    default: throw new Error("Unknown enum value: " + value);
  }
}

//export class YogaWrap {
//  public static readonly NO_WRAP = 0
//  public static readonly WRAP = 1
//  public static readonly WRAP_REVERSE = 2
//
//  private readonly mIntValue: number;
//
//  constructor(intValue: number) {
//    this.mIntValue = intValue;
//  }
//
//  public intValue(): number {
//    return this.mIntValue;
//  }
//
//  public static fromInt(value: number): number | never {
//    switch (value) {
//      case 0: return YogaWrap.NO_WRAP;
//      case 1: return YogaWrap.WRAP;
//      case 2: return YogaWrap.WRAP_REVERSE;
//      default: throw new Error("Unknown enum value: " + value);
//    }
//  }
//}
